<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('动态增删改查')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
	 <th:block th:include="include :: select2-js" />
	 <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
    <script th:inline="javascript">
        var prefix = ctx + "demo/table";

        $(function() {
            var options = {
                url: prefix + "/list",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
		        pagination: false,
		        uniqueId: "userId",
				responseHandler: responseHandler,
		        height: 400,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'userId',
					title : '用户ID'
				},
				{
					field : 'userCode',
					title : '用户编号'
				},
				{
					field : 'userName',
					title : '用户姓名'
				},
				{
					field : 'userPhone',
					title : '用户手机'
				},
				{
					field : 'userEmail',
					title : '用户邮箱'
				},
				{
				    field : 'userBalance',
				    title : '用户余额'
				}]
            };
            $.table.init(options);
        });

		let isOpenDialog = false
		function responseHandler(res) {
			if(!isOpenDialog){
				layer.open({
					type: 2,
					title: '拼版操作',
					fix: false,
					offset: 'r',
					closeBtn: 0,
					shade: 0,
					area: ['65%', '75%'],
					content: prefix + "/test2",
					btn: 0,
				});
			}
		}

		function doSubmit(){
			console.info('子页面调用父页面')
		}

    </script>
</body>
</html>
